﻿using System;
using System.IO;
using System.Text;
using System.Collections.Generic;

namespace zdzh.zdmgr.COL
{
    /// <summary>
    /// 对象名称：回迁协议数据实体类（数据实体层）
    /// 对象说明：该类作为数据载体，供业务逻辑层、数据访问层调用。
    /// 作者姓名：飞翔熊
    /// 编写日期：2012-12-3 13:23:04
    /// </summary>
    [Serializable]
    public class Fangyuan
    {
        #region EasyCode所生成的默认代码
        //﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉﹉
        //  此区域的代码为EasyCode所自动生成，主要用于定义该类的变量属性。请不要直接修改该区域中的任何代码，  
        //  或在该区域中添加任何自定义代码，当该类发生变更时，您可以随时使用EasyCode重新生成覆盖其中的代码。  
        //﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍﹍

        /// <summary>[变量]索引</summary>
        private int index;
        private int type;
        private string build;
        private string unit;
        private string floor;
        private string room;
        private decimal? area;
        private decimal? designarea;
        private int? state;
        private decimal? price;
        private int? xieyiindex;


        public int Index
        {
            get { return index; }
            set { index = value; }
        }

        public int Type
        {
            get { return type; }
            set { type = value; }
        }

        public string Build
        {
            get { return build; }
            set { build = value; }
        }

        public string Unit
        {
            get { return unit; }
            set { unit = value; }
        }

        public string Floor
        {
            get { return floor; }
            set { floor = value; }
        }

        public string Room
        {
            get { return room; }
            set { room = value; }
        }

        public decimal? Area
        {
            get { return area; }
            set { area = value; }
        }

        public decimal? Designarea
        {
            get { return designarea; }
            set { designarea = value; }
        }

        public int? State
        {
            get { return state; }
            set { state = value; }
        }

        public decimal? Price
        {
            get { return price; }
            set { price = value; }
        }

        public int? XieyiIndex
        {
            get { return xieyiindex; }
            set { xieyiindex = value; }
        }

        #endregion EasyCode所生成的默认代码

        public string getRoom()
        {
            string ret = "";
            if (Type == 1 || Type == 4 || Type == 5)
                ret = floor.ToString() + "0" + room.ToString();
            else
                ret = room.ToString();
            return ret;
        }

        public string getBuild()
        {
            string ret = build+" - ";
            if (unit == null && room != null)
                ret += room.ToString();
            else
                ret += unit + " - " + floor + "0" + room;
            return ret;
        }

        public string getArea()
        {
            string ret;
            if (designarea == null)
                ret = "---";
            else
                ret = designarea.ToString();
            ret += " / ";
            if (area == null)
                ret += "---";
            else
                ret += area.ToString();
            return ret;
        }

        public string getState()
        {
            List<string> lstState = new List<string>();
            lstState.Add("---");
            lstState.Add("待售");
            lstState.Add("预定");
            lstState.Add("回迁");
            lstState.Add("销售");
            lstState.Add("锁定");
            lstState.Add("其他");
            return lstState[Convert.ToInt32(state)];
        }

        public string getType()
        {
            List<string> lstType = new List<string>();
            lstType.Add("---");
            lstType.Add("多层");
            lstType.Add("车库");
            lstType.Add("商服");
            lstType.Add("阁楼");
            lstType.Add("高层");

            return lstType[Convert.ToInt32(type)];
        }

        public string getPrice()
        {
            if (price == null)
                return "---";
            else
                return price.ToString();
        }
    }
}
